﻿using System.Collections.Generic;
using System.Linq;
using Red.Controls.Diagrams.ViewModels;
using Red.Controls.ViewModels;

namespace Red.Controls.Diagrams.Actions.InteropActions
{
    public class RemoveNodesAction : InteropActionBase
    {
        #region C-tor

        public RemoveNodesAction( DataItem parentObject, IEnumerable<NodeViewModel> nodes, DiagramViewModel viewModel )
        {
            _parentObject = parentObject;
            _viewModel = viewModel;
            _nodesData = nodes.Select( node => new ActionNodeData( node ) ).ToList();
        }

        #endregion C-tor

        #region Public methods

        public void Execute()
        {
            RemoveNodes( _nodesData, _parentObject );
        }

        #endregion Public methods
    }
}